//
//  ZPTDTableViewCell11.m
//  ZPIOSEducation
//
//  Created by Encoder on 17/1/16.
//  Copyright © 2017年 mini1. All rights reserved.
//

#import "ZPTDTableViewCell11.h"
@interface ZPTDTableViewCell11 ()
@property (weak, nonatomic) IBOutlet UILabel *statuL;
@property (weak, nonatomic) IBOutlet UILabel *priceTypeL;
@property (weak, nonatomic) IBOutlet UIButton *kebiaoBtn;
@property (weak, nonatomic) IBOutlet UIButton *baomingBtn;

@end
@implementation ZPTDTableViewCell11

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    _kebiaoBtn.layer.borderColor = UIColorFromRGB(0x21a4eb).CGColor;
    _kebiaoBtn.layer.borderWidth = 1.;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
- (IBAction)kebiaoBtn:(UIButton *)sender {
    if (_delegate&&[_delegate respondsToSelector:@selector(showKeBiao:courseId:)]) {
        [_delegate showKeBiao:_classId courseId:_courseId];
    }
}
- (IBAction)baomingBtn:(UIButton *)sender {
    if (_delegate && [_delegate respondsToSelector:@selector(baoMingAction:courseId:isfull:)]) {
        [_delegate baoMingAction:_classId courseId:_courseId isfull:_isFull];
    }
}

-(void)setIsFull:(BOOL)isFull{
    _isFull = isFull;
    
    if (_isFull) {
        [_baomingBtn setTitle:@"报名" forState:UIControlStateNormal];
        [_baomingBtn setBackgroundColor:UIColorFromRGB(0x21A4EB)];
        [_baomingBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        _baomingBtn.layer.borderColor = [UIColor grayColor].CGColor;
        _baomingBtn.layer.borderWidth = 0;
    }else{
        [_baomingBtn setTitle:@"报满" forState:UIControlStateNormal];
        [_baomingBtn setTitleColor:UIColorFromRGB(0x999999) forState:UIControlStateNormal];
        [_baomingBtn setBackgroundColor:[UIColor whiteColor]];
        _baomingBtn.layer.borderColor = UIColorFromRGB(0x999999).CGColor;
        _baomingBtn.layer.borderWidth = 1;
    }
    
    
    
}

-(void)setStatus:(NSString*)status{
    _status = status;
    _statuL.text = _status;

}

-(void)setPriceType:(BOOL)priceType{
    _priceType = priceType;
    if (priceType == 0) {
        _priceTypeL.text=@"插班价";
    }else if (priceType==1){
        _priceTypeL.text=@"报名价";
    }
}

@end
